package guoanmaker.personal.business.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.personal.business.model.PersonalInvoice;
/**
 * 
* @ClassName: PersonalInvoiceRepository 
* @Description: 发票repository
* @author Yvonne_MGL
* @date 2017年7月6日 下午3:51:23 
*  
 */
public interface PersonalInvoiceRepository
		extends JpaRepository<PersonalInvoice, String>, JpaSpecificationExecutor<PersonalInvoice> {
	/**
	 * 
	* @Description: 修改发票是否为默认发票属性 
	* @param user_id 用户id
	* @author Yvonne_MGL 
	* @date 2017年7月6日 下午3:51:39     
	* @return void    
	* @throws 
	 */
	@Modifying 
	@Query("update PersonalInvoice i set i.isdefault='0' where i.user.id=:user_id")
	public void updateInvoiceIsdefault(@Param("user_id")String user_id);

}
